<?php
	class ForumModel extends Model{
		function ForumModel(){
	        parent::Model();
	    }
	    function select($id=null){
	    	if(!$id){
	    		$data=$this->db->select('forum.*,user.nickname')->join('user','forum.user_id=user.id','left')->order_by('sort_id','desc')->get('forum')->result_array();
	    	}
	   		else{
	   			$data=$this->db->select('forum.*,user.nickname')->join('user','forum.user_id=user.id','left')->where('forum.id',$id)->get('forum')->row_array();
	   		}
	    	return $data;
	    }
	    function insert(){}
	    function update(){}
	    function delete(){}
	}
?>